Ext.define('carManage.view.milageInfo.GridList', {
    extend: 'Ext.grid.Panel',
    store: 'MilageInfoStore',
    alias: 'widget.gridList',
    selModel: Ext.create('Ext.selection.CheckboxModel', {mode: "SIMPLE"}),
    initComponent: function() {
        this.columns = [
            {
                header: '车牌号码',
                sortable: true,
                width: 95,
                dataIndex: 'car_code'
            }, {
                header: '驾驶员',
                sortable: true,
                width: 100,
                dataIndex: 'driver'
            }, {
                header: '时间',
                sortable: true,
                width: 95,
                dataIndex: 'time'
            }, {
                header: '编号',
                sortable: true,
                hidden: true,
                dataIndex: 'id'
            }, {
                header: '费用项目名称',
                sortable: true,
                hidden: true,
                dataIndex: 'name'
            }, {
                header: '仪表盘读数',
                sortable: true,
                width: 120,
                dataIndex: 'milage',
                renderer: function(v) {
                    return v + "公里";
                }
            }, {
                header: '本月公里数',
                sortable: true,
                width: 300,
                dataIndex: 'remark',
                renderer: function(v) {
                    if (v) {
                        return v + "公里";
                    }else{
                      return "<font color='red'>上月未录入数据</font>";   
                    }
                }
            }
        ];

        this.bbar = new Ext.PagingToolbar({
            store: 'MilageInfoStore',
            emptyMsg: '没有数据需要显示',
            displayInfo: true
        });
        this.callParent(arguments);
    }
});